package com.wmh.baseservice.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;

import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author wmh generator
 * @since 2022-01-17
 */
@ApiModel(value="SysLocation对象", description="系统-行政区域")
public class SysLocation implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String name;

    private String val;

    private String parentVal;

    private String province;

    private String city;

    private String area;

    @TableField(exist = false)
    private List<SysLocation> cityS;

    public List<SysLocation> getCityS() {
        return cityS;
    }

    public void setCityS(List<SysLocation> cityS) {
        this.cityS = cityS;
    }

    public Integer getId() {
        return id;
    }

    public SysLocation setId(Integer id) {
        this.id = id;
        return this;
    }
    public String getName() {
        return name;
    }

    public SysLocation setName(String name) {
        this.name = name;
        return this;
    }
    public String getVal() {
        return val;
    }

    public SysLocation setVal(String val) {
        this.val = val;
        return this;
    }
    public String getParentVal() {
        return parentVal;
    }

    public SysLocation setParentVal(String parentVal) {
        this.parentVal = parentVal;
        return this;
    }
    public String getProvince() {
        return province;
    }

    public SysLocation setProvince(String province) {
        this.province = province;
        return this;
    }
    public String getCity() {
        return city;
    }

    public SysLocation setCity(String city) {
        this.city = city;
        return this;
    }
    public String getArea() {
        return area;
    }

    public SysLocation setArea(String area) {
        this.area = area;
        return this;
    }

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String VAL = "val";

    public static final String PARENT_VAL = "parent_val";

    public static final String PROVINCE = "province";

    public static final String CITY = "city";

    public static final String AREA = "area";

    @Override
    public String toString() {
        return "SysLocation{" +
            "id=" + id +
            ", name=" + name +
            ", val=" + val +
            ", parentVal=" + parentVal +
            ", province=" + province +
            ", city=" + city +
            ", area=" + area +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            SysLocation.ID
            ,SysLocation.NAME
            ,SysLocation.VAL
            ,SysLocation.PARENT_VAL
            ,SysLocation.PROVINCE
            ,SysLocation.CITY
            ,SysLocation.AREA
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}